FROM openjdk:8-jre-slim
MAINTAINER admin

ENV PARAMS=""

ENV COPS=""

ENV TZ=PRC

RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

ADD target/fjec-market-*.jar /app.jar

#RUN mkdir -p .fonts

COPY simfang.ttf /usr/share/fonts/truetype/dejavu/

RUN rm -f /etc/apt/sources.list

RUN echo "deb http://mirrors.163.com/debian/ buster main non-free contrib\
          deb http://mirrors.163.com/debian/ buster-updates main non-free contrib\
          deb http://mirrors.163.com/debian/ buster-backports main non-free contrib\
          deb http://mirrors.163.com/debian-security/ buster/updates main non-free contrib\
          deb-src http://mirrors.163.com/debian/ buster main non-free contrib\
          deb-src http://mirrors.163.com/debian/ buster-updates main non-free contrib\
          deb-src http://mirrors.163.com/debian/ buster-backports main non-free contrib\
          deb-src http://mirrors.163.com/debian-security/ buster/updates main non-free contrib" >> /etc/apt/sources.list;\
         apt update;\
         apt install -y fontconfig;\
         fc-cache -f -v

ENTRYPOINT ["sh","-c","java -jar $JAVA_OPTS $COPS /app.jar $PARAMS"]